#include <stdio.h>
#include <ctype.h>

int main(){
    char c=' ';
    printf("Enter a string: ");
    do{
        scanf("%c",&c);
        if('a'<=c<='z'){
            putchar(toupper(c));
        }else if('A'<=c<='Z'){
            putchar(tolower(c));
        }else{
            putchar(c);
        }
    }while(c!='|');
    printf("\n");
    return 0;
}
